summaryrefslogtreecommitdiff
path: root/app/[lng]/evcp/(evcp)/(master-data)/evaluation-target-list/page.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-09-29 08:01:53 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-09-29 08:01:53 +0000
commitc7d37ec3e60c9197abc79738316ddae7c5bf8817 (patch)
tree9b045c7b7302d55f43d76565aa4fd5c6dd3a097b /app/[lng]/evcp/(evcp)/(master-data)/evaluation-target-list/page.tsx
parent82a2ce067c9b690cdf7775dfb0be94583f51ca29 (diff)
(대표님) 그룹라우터로 앱라우터 경로 정리
Diffstat (limited to 'app/[lng]/evcp/(evcp)/(master-data)/evaluation-target-list/page.tsx')
-rw-r--r--app/[lng]/evcp/(evcp)/(master-data)/evaluation-target-list/page.tsx87
1 files changed, 87 insertions, 0 deletions
diff --git a/app/[lng]/evcp/(evcp)/(master-data)/evaluation-target-list/page.tsx b/app/[lng]/evcp/(evcp)/(master-data)/evaluation-target-list/page.tsx
new file mode 100644
index 00000000..325037d8
--- /dev/null
+++ b/app/[lng]/evcp/(evcp)/(master-data)/evaluation-target-list/page.tsx
@@ -0,0 +1,87 @@
+import * as React from "react"
+import { Metadata } from "next"
+import { type SearchParams } from "@/types/table"
+import { Shell } from "@/components/shell"
+import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton"
+import { Badge } from "@/components/ui/badge"
+
+import { getDefaultEvaluationYear, searchParamsEvaluationTargetsCache } from "@/lib/evaluation-target-list/validation"
+import { getEvaluationTargets } from "@/lib/evaluation-target-list/service"
+import { InformationButton } from "@/components/information/information-button"
+import { EvaluationTargetsTable } from "@/lib/evaluation-target-list/table/evaluation-target-table"
+
+export const dynamic = 'force-dynamic'
+export const revalidate = 0
+
+export const metadata: Metadata = {
+ title: "협력업체 평가 대상 관리",
+ description: "협력업체 평가 대상을 확정하고 담당자를 지정합니다.",
+}
+
+interface EvaluationTargetsPageProps {
+ searchParams: Promise<SearchParams>
+}
+
+export default async function EvaluationTargetsPage(props: EvaluationTargetsPageProps) {
+ const searchParams = await props.searchParams
+
+ // ✅ 간소화된 파싱
+ const search = searchParamsEvaluationTargetsCache.parse(searchParams)
+
+ // 현재 평가년도
+ const currentEvaluationYear = search.evaluationYear || getDefaultEvaluationYear()
+
+ // ✅ 단순화된 서비스 호출 (필터 처리는 테이블에서 담당)
+ const promises = Promise.all([
+ getEvaluationTargets(search)
+ ])
+
+ return (
+ <Shell className="gap-4">
+ {/* Header */}
+ <div className="flex items-center justify-between space-y-2">
+ <div className="flex items-center gap-2">
+ <h2 className="text-2xl font-bold tracking-tight">
+ 협력업체 평가 대상 관리
+ </h2>
+ <InformationButton pagePath="evcp/evaluation-target-list" />
+ <Badge variant="outline" className="text-sm">
+ {currentEvaluationYear}년도
+ </Badge>
+ </div>
+ </div>
+
+ {/* Main Table */}
+ <React.Suspense
+ // key={`evaluation-targets-${search.page}-${JSON.stringify(search.filters)}-${search.joinOperator}-${search.search || 'no-search'}`}
+ fallback={
+ <DataTableSkeleton
+ columnCount={12}
+ searchableColumnCount={2}
+ filterableColumnCount={6}
+ cellWidths={[
+ "3rem", // checkbox
+ "5rem", // 평가년도
+ "4rem", // 구분
+ "8rem", // 벤더코드
+ "12rem", // 벤더명
+ "4rem", // 내외자
+ "6rem", // 자재구분
+ "5rem", // 상태
+ "5rem", // 의견일치
+ "8rem", // 담당자현황
+ "10rem", // 관리자의견
+ "8rem" // actions
+ ]}
+ shrinkZero
+ />
+ }
+ >
+ <EvaluationTargetsTable
+ promises={promises}
+ evaluationYear={currentEvaluationYear}
+ />
+ </React.Suspense>
+ </Shell>
+ )
+} \ No newline at end of file